<?php
/**
 * Zead
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.opensource.org/licenses/bsd-license.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to eu@marcelomx.com so we can send you a copy immediately.
 *
 * @category   Zead
 * @author     Marcelo Rodrigues Gonzaga <eu@marcelomx.com>
 * @copyright  Copyright (c) 2008 Marcelo Rodrigues Gonzaga
 * @link       http://code.google.com/p/zead
 * @license    http://www.opensource.org/licenses/bsd-license.php     New BSD License
 *
 **/



/** @see Zend_Controller_Action **/
require_once 'Zend/Controller/Action.php';

/**
 * Class BuilderController
 *
 * Provides an interface to builder educational objects from html.
 *
 */
class BuilderController extends Zend_Controller_Action
{
	/**
	 * Controller index action
	 *
	 */
	public function indexAction()
	{
		// @TODO To be implements
	}

	public function editAction()
	{


	    $course = new Course();
	    $course->title = 'Object oriented programming';
	    $course->is_active = true;
	    $course->is_restrict = false;

	    $course->save();

	    // Create content
	    $content = new Content();
	    $content->course_id = $course->id;
	    $content->title = 'Lesson 1 - Classes and interfaces ';
	    $content->name  = 'lesson-1';
	    $content->label = 'Lesson 1';
	    $content->url   = null;
	    $content->text  = 'The programming content object is a interface very high';
	    $content->is_visible  = true;
	    $content->is_active    = true;
	    $content->is_printable = true;
	    $content->save();

	    sleep(2);

	    $content->title = 'Mudei o titulo';
	    $content->save();

	    sleep(3);

	    $content->text = 'Agora só mudei o conteúdo';
	    $content->save();
	    die();
	}
}
?>